"use strict"

/**
 * 北京市科学技术委员会基金爬虫
 *  找不到招标信息
 */

var Base = require("./base");
var kxjs_spider = new Base();
kxjs_spider.name = "北京市科学技术委员会";
// kxjs_spider.contentType = "text";

kxjs_spider.getPageUrl = function(pg) {
    var url = "http://www.bjkw.gov.cn/n8785584/n8904761/n8904870/index.html"
    if(pg != 1){
        url = "http://www.bjkw.gov.cn/n8785584/n8904761/n8904870/index_" + (108 - pg)+".html";
    }
    return url;
};

kxjs_spider.getItems = function($) {
    var items = [];
    $(".line_greydashed tr td a").each(function(index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.attr("title");
        item.url = "http://www.bjkw.gov.cn" + e.attr("href");
        item.source = kxjs_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = kxjs_spider;